package com.gdawj.javabeans;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
@IdClass(EtudiantCoursID.class)
public class EtudiantCours implements Serializable {

    @Id private Long idEtudiant;
    @Id private Long idCours;
    private boolean absence;
    private String motif;
    // lien vers la classe Etudiant
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name="IDETUDIANT",insertable=false,updatable=false)
    private Etudiant etudiant;
    // lien vers la classe Cours
    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumn(name="IDCOURS",insertable=false,updatable=false)
    private Cours cours;


    public EtudiantCours()
    {

    }

    public boolean isAbsence() {
        return absence;
    }

    public void setAbsence(boolean absence) {
        this.absence = absence;
    }

    public Cours getCours() {
        return cours;
    }

    public void setCours(Cours cours) {
        this.cours = cours;
    }

    public Etudiant getEtudiant() {
        return etudiant;
    }

    public void setEtudiant(Etudiant etudiant) {
        this.etudiant = etudiant;
    }

    public Long getIdCours() {
        return idCours;
    }

    public void setIdCours(Long idCours) {
        this.idCours = idCours;
    }

    public Long getIdEtudiant() {
        return idEtudiant;
    }

    public void setIdEtudiant(Long idEtudiant) {
        this.idEtudiant = idEtudiant;
    }

    public String getMotif() {
        return motif;
    }

    public void setMotif(String motif) {
        this.motif = motif;
    }

    
}
